package schoolword;

public class Test3 {
    public static void main(String[] args) {

        //使用lambda表达式创建线程
        Thread t1 = new Thread(() -> {
            for (int i = 0; i < 10; i++) {
                System.out.println("线程1正在运行");
            }
        });
        t1.setPriority(10);


        Thread t2 = new Thread(() ->{
            for (int i = 0; i <10; i++) {
                System.out.println("线程2正在运行");
            }
        });
        t2.setPriority(3);

        t1.start();
        t2.start();
    }
}
